﻿<%@ Control Language="C#" AutoEventWireup="true" Inherits="HL.Lib.MVC.ViewControl" %>
<%
    int NewsID = ViewPage.ViewBag.NewsID > 0 ? ViewPage.ViewBag.NewsID : 0;
    if (NewsID > 0)
    {
        var news = ModNewsService.Instance.GetByID(NewsID);
        if (news != null && (!string.IsNullOrEmpty(news.Map)))
        {
     %>
<div class="maptt" <%if(!string.IsNullOrEmpty(news.MapUrl)){ %>onclick="window.open('<%=news.MapUrl %>','_blank')"<%}else{ %>
onclick="$.prettyPhoto.open('<%= news.Map.Replace("~/","/") %>','<%=news.Name %>','<%=news.Name %>'); return false"
<%} %>>
    <p>
        Phóng to</p>
</div>
<div class="map cornerbottomleft">
    <a href="javascript:;" onclick="$.prettyPhoto.open('<%= news.Map.Replace("~/","/") %>','<%=news.Name %>','<%=news.Name %>'); return false">
        <img src="<%= news.Map.Replace("~/","/") %>" width="242" height="209" alt="map" /></a>
    <p><%=news.Name %></p>
</div>
<link rel="stylesheet" href="/Content/popup/css/prettyPhoto.css" type="text/css"
    media="screen" title="Song Hỷ" charset="utf-8" />
<script src="/Content/popup/js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
    $(document).ready(function () {
        $("area[rel^='prettyPhoto']").prettyPhoto();

        $(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({ animation_speed: 'normal', theme: 'light_square', slideshow: 3000, autoplay_slideshow: true });
        $(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({ animation_speed: 'fast', slideshow: 10000, hideflash: true });

        $("#custom_content a[rel^='prettyPhoto']:first").prettyPhoto({
            custom_markup: '<div id="map_canvas" style="width:260px; height:265px"></div>',
            changepicturecallback: function () { initialize(); }
        });

        $("#custom_content a[rel^='prettyPhoto']:last").prettyPhoto({
            custom_markup: '<div id="bsap_1259344" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div><div id="bsap_1237859" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6" style="height:260px"></div><div id="bsap_1251710" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div>',
            changepicturecallback: function () { _bsap.exec(); }
        });
    });
			</script>
<style type="text/css" media="screen">
    .bsap a
    {
        float: left;
    }
</style>
<script type="text/javascript">
    (function () {
        var bsa = document.createElement('script');
        bsa.type = 'text/javascript';
        bsa.async = true;
        bsa.src = '//s3.buysellads.com/ac/bsa.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(bsa);
    })();
			</script>
            <%}
    } %>